package com.kreedx.kdemo.common;

import android.support.v4.app.Fragment;

import com.kreedx.kdemo.module.HomeFragment;
import com.kreedx.kdemo.module.SocketFragment;
import com.kreedx.kdemo.module.TangramDemoFragment;

public class FragmentFactory {
    private FragmentFactory() {
    }

    public final static String listStrings[] = new String[]{
            "sokect","tangram"
    } ;

    public static Fragment getFragmentByName(String name){
        if(name != null){
            if(name.equals(listStrings[0])){
                return SocketFragment.newInstance();
            }else if(name.equals(listStrings[1])){
                return TangramDemoFragment.newInstance();
            }
        }
        return HomeFragment.newInstance();
    }
}
